﻿using Microsoft.Extensions.DependencyInjection;
using Sgr;
using Sgr.AspNetCore.Middlewares.Security;
using System;

namespace Microsoft.AspNetCore.Builder
{
    public static class WebApplicationBuilderExtensions
    {
        public static WebApplicationBuilder AddSgrWebBuilder(
            this WebApplicationBuilder builder,
            Action<WebApplicationAddOptions>? configure = null)
        {
            builder.Services.AddSgrWeb(builder.Configuration, builder.Environment, configure);

            builder.AddSecurityHeaders();

            return builder;
        }
    }
}